Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Cómo cambiar "/" en la primera palabra con la función si tiene 3 palabras y 2 palabras no son válidas

tengo 3 variables

 let oneWord = "offering" let twoWord = "test_offering" let threeWord = "loan_offering_data"

Quiero hacer dónde si el valor de TwoWord se ejecuta/muestra como oferta de prueba y supongamos que el valor de threeWord se ejecuta/muestra, se convierte en préstamo/datos de oferta

¿Cómo hacer que una función cumpla con los criterios anteriores de forma dinámica?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

function reformat(word) { const wds=word.split("_"); if (wds.length ===1) return word; if (wds.length ===2) return wds.join("-"); if (wds.length ===3) return `${wds[0]}/${wds[1]}-${wds[2]}`; throw new Error("too many words"); }
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!